var productDetail = Vue.extend({

data(){
  return{
    classId:"",
    productId:""
  };
},
mounted: function() {
    //console.log(this.productDet , typeof (this.productDet));
    this.productArr = this.productDet;
    this.getId();
},
watch:{
  $route(to){
    this.classId = this.$route.params.index;
    this.productId = this.$route.params.innerIndex;
    //console.log(this.classId , this.productId);
  }
},
props: ['productDet'],
methods: {
    getId(){
        var reg = /\/productDetail\/(\d+)\/(\d+)/;
        this.classId = this.$route.path.match(reg)[1];
        this.productId = this.$route.path.match(reg)[2];
        //console.log(this.classId , this.productId);        
    }
},
template:'\
<div>\
<div class="pro_zi_show">\
    <div class="pro_show1 clearfix">\
        <div class="left">\
            <img v-bind:src="productDet.data[this.classId].productList[this.productId].image" alt="" class="vcenter" />\
            <i></i>\
        </div>\
        <div class="right">\
            <h4 v-text="productDet.data[this.classId].productList[this.productId].name"></h4>\
            <p v-text="productDet.data[this.classId].productList[this.productId].description"></p>\
        </div>\
    </div>\
    <div class="pro_show2">\
        <div class="top_3">产品参数</div>\
        <div class="pro_attribute">\
            <ul>\
                <li v-for="(item,index) in productDet.data[this.classId].productList[this.productId].attribute"><span v-text="index"></span><span v-text="item"></span></li>\
            </ul>\
        </div>\
        <div v-html="productDet.data[this.classId].productList[this.productId].info"></div>\
    </div>\
    <ul class="prev_next clearfix">\
        <li><b>上一篇：</b><router-link :to="\'/productDetail/\' + this.classId + \'/\' + this.productId" >暂无信息！</router-link></li>\
        <li><b>下一篇：</b><router-link :to="\'/productDetail/\' + this.classId + \'/\' + this.productId+1" >AP5.4经济型工业级条码机</router-link></li>\
    </ul>\
</div>\
</div>\
',

});